ICONS_MP:=icon goto-pos goto-target pick-current change-type change-mark \
	change-size new-neuron del-neurons purge-neurons \
	find-path connect-points refine-path \
	tracing-done tracing-branch tracing-extend \
	mark1 mark2 mark3 mark0

$(addprefix generated/,$(addsuffix .svg,$(ICONS_MP))): gen-icons.mp
	mkdir -p temp
	mkdir -p generated
	cd temp; context ../gen-icons.mp
	cd temp; pdfseparate gen-icons.pdf 'gen-icons-sep-%d.pdf'
	cd temp; i=1; for x in $(ICONS_MP); do pdftocairo -svg gen-icons-sep-$$i.pdf $$x.svg; i=`expr $$i + 1`; done
	cd temp; for x in $(ICONS_MP); do rsvg-convert -f svg $$x.svg > ../generated/$$x.svg; done

